<?php
namespace app\service;

trait Instance
{
    /**
     * @var static
     */
    private static $_instance;

    /**
     * @param ...$args
     */
    private function __construct(...$args){}

    /**
     * getInstance
     * @param ...$args
     * @return static
     */
    public static function getInstance(...$args)
    {
        if (!isset(self::$_instance)) {
            self::$_instance = new static(...$args);
        }
        return self::$_instance;
    }

}